package init;

/**
 * @author:Gan Linghao
 * @date:2020/7/16 0016
 * @time:14:13
 * @description:no description
 */
public enum SeasonEnum {
    /**
     * 1： 春天
     */
    SPRING(1, "春天"),
    /**
     * 2： 夏天
     */
    SUMMER(2, "夏天"),
    /**
     * 3： 秋天
     */
    FALL(3,"秋天"),
    /**
     * 4： 冬天
     */
    WINTER(4,"冬天")
    ;

    // 成员变量
    private Integer num;
    private String desc;

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    // 构造器
    SeasonEnum(Integer num, String desc) {
        this.num = num;
        this.desc = desc;
    }

    // 成员方法
    public static String getResult (Integer num) {
        StringBuffer temp = new StringBuffer();
        SeasonEnum[] sea = SeasonEnum.values();
        for (SeasonEnum s : sea) {
            if (num == s.getNum()) {
                temp.append(s.getDesc());
            }
        }
        return temp.toString();

    }

}
